import type { LoginRequest, LoginResponse } from '@/api/model/authModel';
import { request } from '@/utils/request';

const Api = {
  Login: '/auth/login',
  Logout: '/auth/logout',
  UserInfo: '/auth/userinfo',
};

export function login(data: LoginRequest) {
  return request.post<LoginResponse>({
    url: Api.Login,
    data,
  });
}

export function logout() {
  return request.post({
    url: Api.Logout,
  });
}

export function getUserInfo() {
  return request.get({
    url: Api.UserInfo,
  });
}
